
var app = new Vue({
    el: '#wrap',
    data: {
        city: null,
        weatherList: []
    },
    methods: {
        searchWeather: function () {
            console.log(this);
            var that = this;
            axios.get('http://wthrcdn.etouch.cn/weather_mini?city='+this.city)
                .then(function (response) {                    
                    console.log(response.data.data.forecast);
                    that.weatherList = response.data.data.forecast;
                })
                .catch(function (err) { })
        },
        changeCity:function(city){
            this.city = city;
            this.searchWeather();
        }
    }
})